Arduino car entry-fourth day (sensor), arduino car
Hello everyone, I am a small Editor.
Record the content in the previous section and click "open link ".
Today we will talk about sensors.
Today we will talk about light and ultrasound.
Start with a chart:
There are three optical interfaces:
UCC, out, And GND.
Ultrasonic has four interfaces:
UCC, T, E, And GND.
T
Through this article, you can learn the following: basic information and wiring method of the hc-sr501 sensor hc-sr501 jumper Select two time modes hc-sr501 simple function Experiment hc-sr501 sensor basic information and wiring method
The hc-sr501 is a pyroelectric-based body heat-release motion sensor that detects infrared rays emitted by humans or animals. The
Through the first two articles, we have become familiar with the basic GPIO programming of Arduino and the serial communication between PC and Arduino. Next we're going to start learning all kinds of sensor operations while delving into Arduino programming.
Before we start programming, we need to be familiar with the p
*/#define DHT_PIN 2/IO temperature and humidity sensor data/#define TRG_PIN 3/O distance sensor start/#define EC H_pin/I distance sensor data input/#define ALM_PIN 4/* o buzzer Output/#define HMC_PIN 8/I body sensor data loss Ent
Bh1750fvi is a digital ambient optical sensor IC produced by Rohm semiconductor in Japan. Its main features include:
I2C digital interface, supporting a maximum rate of 400 kHz
Illuminance)
Measurement Range: 1 ~ 65535 Lux, minimum resolution
Power down
Shielding illumination variation interference caused by 50/60Hz Mains Frequency
Two I2C addresses are supported and selected through the ADDR pin.
Small measurement error (maximum precision err
serial communication-using a computer to control a tri-color LED module 785.3.1 Tri-color led Module 785.3.2 Wiring Method 785.3.3 Drive Tri-color led Module 795.4 Complete knowledge of analog input signals 825.4.1 Brightness sensor 825.4.2 Temperature sensor 845.4.3 Accelerometer 855.5 Interrupt 875.5.1 binding interrupt 875.5.2 Cancel Interrupt 89The 6th chapter of the project tomato Alarm Cl
serial port: read a value from the analog input pin and use this value to control the LED lightAnalog signal Input: Use a potentiometer to control the blinking of the LEDs.Analog output [Mega]: Use the Arduino Mega board to allow 12 LEDs to fade in one after the other.Analog signal Calibration: Set the maximum and minimum value of the sensor output analog signal to achieve the desired effect.LED brightness
(intThispin = Lowestpin; Thispin //Let LED fade: for(intBrightness =0; Brightness 255; brightness++) {analogwrite (thispin, brightness); Delay2); }//Let the LED fade: for(intBrightness =255; Brightness >=0; brightness--) {analogwrite (thispin, brightness); Delay2); }//Between LED gradients delay:Delay -); }}Related Informationfor ()Analogwrite ()Delay ()Analog signal and serial port: read a value from the analog input pin and use this value to control the LED lightAnalog signal
Memsic2125 Acceleration Meter
MEMSIC2125 is a two-axis accelerometer that can measure the acceleration of positive or negative 2g in two directions (g represents the gravitational acceleration). Its pin design is simple: Only two data output pins, one for the x axis and one for the Y axis. Its data output pins will output different pulse widths according to the size of the acceleration (do not know what the pulse width is please see this article). The subtle level of pulse width can be measured
Android practice simple tutorial-62nd guns (electronic Sensor exact Compass)
Here we use the sensor provided by the mobile phone to implement a simple small example of the electronic compass. You can learn how to use the SensorManager class, SensorEventListener and its overwriting method.
First, create a layout file:
Then the Activity file:
element
Const INT threshold = Limit value for detecting whether there is a vibration
//variable:
int sensorreading = 0; The variable that stores the value
int ledstate = low; Storage led state Volume
void Setup () {
pinmode (ledpin, output);//declare Ledpin as output mode
serial.begin (9600); Serial Port
}
void Loop () {
//Read the value of the sensor and deposit the sensorreading variable:
sensorreading = Analogread (k
distance of the obstacle. The Grove-ultrasonic Ranger has four pins, namely power supply, ground, signal pin, and one pin dangling. Connect the Raspberry Pi and module as follows: After checking out the code from GitHub, enter it in the Raspberry Pi terminal lxterminal:CD "Grove–ultrasonic Ranger"sudo python ultrasonic.pyThe Raspberry Pi can drive the Ultrasonic Ranger module to work: 2. Infrared human detectionInfrared human body
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.